package com.yswy.domain.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yswy.domain.common.BasePojo;
import com.yswy.domain.entity.user.User;
import com.yswy.domain.vo.gld.addOrUpate.AppProjectAddOrUpdate;
import com.yswy.domain.vo.gld.filter.UserProjectVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;

import java.util.List;

@Data
@Builder
@AllArgsConstructor
@Api(tags = "app项目表")
@TableName(value = "app_project")
public class AppProject extends BasePojo<AppProject> {

    @ApiModelProperty("项目名字")
    private String projectName ;


    @ApiModelProperty("软著Id")
    private Long softnessId;

    @ApiModelProperty("官网")
    private String officialWebsite;
    @ApiModelProperty("服务器ip")
    private String serverIp;
    @ApiModelProperty("域名")
    private String domainName;
    @ApiModelProperty("redis地址")
    private String redisAddress;
    @ApiModelProperty("数据库地址")
    private String databaseAddress;
    @ApiModelProperty("投放（上架）平台 ")
    private String tfPlatform;


    @ApiModelProperty("使用用户")
    @TableField(exist = false)
    private List<UserProjectVO> userNames;
    @ApiModelProperty("软著")
    @TableField(exist = false)
    private String softness;
    @ApiModelProperty("软著备案号")
    @TableField(exist = false)
    private String softnessNo;
    @ApiModelProperty("包名")
    @TableField(exist = false)
    private String packageName;
    public AppProject(AppProjectAddOrUpdate listAppProjectReqVO , User user) {
        this.projectName = listAppProjectReqVO.getProjectName();
        this.serverIp = listAppProjectReqVO.getServerIp();
        this.domainName = listAppProjectReqVO.getDomainName();
        this.softnessId = listAppProjectReqVO.getSoftnessId();
        this.officialWebsite = listAppProjectReqVO.getOfficialWebsite();
        this.redisAddress = listAppProjectReqVO.getRedisAddress();
        this.databaseAddress = listAppProjectReqVO.getDatabaseAddress();
        this.tfPlatform = listAppProjectReqVO.getTfPlatform();
        super.setCreateBy(user.getId().longValue());
    }
    public AppProject() {

    }
}
